package com.sina.shop.domain.collect;

import com.sina.shop.domain.goods.Goods;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2017-12-11-16:05
 */
@Entity
@Table(name = "tb_collect_goods")
@DiscriminatorValue("2")
@DynamicInsert
@DynamicUpdate
public class CollectGoods extends Collect {

    @ManyToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    @JoinColumn(name = "gid")
    private Goods goods;//收藏的商品

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }
}
